/**
 * Created by Jay on 2016/6/16.
 */
function  add_version(){
    var version=$("#add_version_1").Validform({
        btnSubmit:".edit_version",
        tiptype:3,
        label:".label",
        showAllError:true,
        datatype:{
            "zh1-6":/^[\u4E00-\u9FA5\uf900-\ufa2d]{1,6}$/,
            "num":/^[0-9]*$/
        },
        ajaxPost:true
    });//表单验证
    //通过$.Tipmsg扩展默认提示信息;
    //$.Tipmsg.w["zh1-6"]="请输入1到6个中文字符！";
    version.tipmsg.w["zh1-6"]="请输入1到6个中文字符！";

    version.addRule([{
        ele:".inputxt:eq(0)",
        datatype:"zh2-4"
    },
        {
            ele:".inputxt:eq(0)",
            datatype:"*"
        },
        {
            ele:".inputxt:eq(1)",
            datatype:"*"
        },
        {
            ele:".inputxt:eq(2)",
            datatype:"*"
        },
        {
            ele:".inputxt:eq(3)",
            datatype:"*"
        },
        {
            ele:".inputxt:eq(4)",
            datatype:"*"
        }
        //{
        //    ele:"select",
        //    datatype:"*"
        //}
    ]);

    $(".add_version").click(function(){
        var form_data=$("#add_version_1").serialize();
        mccmsa.ajax({
            url: "versionManageController/addNewVersionInfo",
            method: "post",
            data:form_data,
            success: function (data) {
                if(data.status!=200){
                    layer.alert("添加失败");
                    return;
                }
                layer.alert("添加成功");
                mccmsa.goTo("version_control","add_version");

            }
        })
    })
}